1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
| \documentclass{article} \usepackage[dvipdfm]{graphicx} \def\pgfsysdriver{pgfsys-dvipdfmx.def} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{width=7cm,compat=1.15} \usepgfplotslibrary{groupplots} \usepackage{caption} \usepackage{subcaption} \usepackage[colorlinks,dvipdfm, pdfpagemode=UseOutlines, pdfstartview=FitH, anchorcolor=green, citecolor=blue, linkcolor=red, hyperindex=true, pagebackref, bookmarksnumbered, bookmarksopenlevel=2, colorlinks]{hyperref} \begin{document} \begin{figure}[htb] \centering \begin{tikzpicture} \begin{groupplot}[ group style={ group name=my plots, group size=2 by 2, xlabels at=edge bottom, xlabels at=all, ylabels at=edge left, x descriptions at=edge bottom, }, footnotesize, width=6cm, height=6cm, % xlabel=$x$, ylabel=$f(x)$, ] \nextgroupplot \addplot {x}; \node [text width=1em,anchor=north west] at (rel axis cs: 0,1) {\subcaption{\label{f11}}};%<- changed \nextgroupplot \addplot {x^2}; \nextgroupplot \addplot {x^3}; \nextgroupplot \addplot {x^4}; \end{groupplot} \end{tikzpicture} \caption{\hspace{1em}Four subfigures.}\label{f1} \end{figure} How to refer to subfigure~\ref{f11} in Figure~\ref{f1}.
\end{document}
|